const cacheMap = new Map();

export const loadFile = async (
    categoryName: string, 
    packageName: string, 
    fileName: string) => {
    const key = `../components/${categoryName}/${packageName}/${fileName}`;
    const value = cacheMap.get(key);
    if (value) {
        return value;
    } else {
        const configFile = await import(key);
        cacheMap.set(key, configFile.default);
        return configFile.default;
    }
}